ARD2  1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
freemaster_serial.c File Reference

FreeMASTER serial communication routines. More...

#include "freemaster.h"
#include "freemaster_private.h"
#include "freemaster_protocol.h"

Data Structures

union  FMSTR_SERIAL_FLAGS

Functions

void FMSTR_ProcessSCI (void)
 Handle SCI communication (both TX and RX)
void FMSTR_SendResponse (FMSTR_BPTR pResponse, FMSTR_SIZE8 nLength)
 Finalize transmit buffer before transmitting.
FMSTR_BOOL FMSTR_Tx (FMSTR_U8 *pTxChar)
 Output buffer transmission.
FMSTR_BOOL FMSTR_Rx (FMSTR_BCHR nRxChar)
 Handle received character.
FMSTR_BOOL FMSTR_InitSerial (void)
 Serial communication initialization.
void FMSTR_Poll (void)

Detailed Description

FreeMASTER serial communication routines.

Version:
1.1.28.0
Date:
Jun-6-2011

Function Documentation

void FMSTR_ProcessSCI ( void  )

Handle SCI communication (both TX and RX)

This function checks the SCI flags and calls the Rx and/or Tx functions

Note:
This function can be called either from SCI ISR or from the polling routine
FMSTR_BOOL FMSTR_Rx ( FMSTR_BCHR  nRxChar)

Handle received character.

Parameters:
nRxCharThe character to be processed

Handle the character received and -if the message is complete- call the protocol decode routine.

void FMSTR_SendResponse ( FMSTR_BPTR  pResponse,
FMSTR_SIZE8  nLength 
)

Finalize transmit buffer before transmitting.

Parameters:
nLength- response length (1 for status + data length)

This Function takes the data already prepared in the transmit buffer (inlcuding the status byte). It computes the check sum and kicks on tx.

FMSTR_BOOL FMSTR_Tx ( FMSTR_U8 *  pTxChar)

Output buffer transmission.

Parameters:
pTxCharThe character to be transmit

get ready buffer(prepare data to send)